package com.test2015.ui.button;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JWindow;

import com.sun.awt.AWTUtilities;

public class TranslucentWindow extends JWindow{
	
	String iconPath = "com/test2015/ui/button/res2/loading.gif";
	
	public TranslucentWindow(){
		
		Icon imageIcon = new ImageIcon(ClassLoader.getSystemResource(iconPath));
//		Icon imageIcon = new ImageIcon("img/refresh.png");
		
		JLabel label = new JLabel(imageIcon );
		
		getContentPane().add(label, "Center");
		AWTUtilities.setWindowOpaque(this, false);
		this.setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
		this.setLocationRelativeTo(null);
		this.setVisible(true);
	}
	
	
	public static void main(String[] args) {
		new TranslucentWindow();
	}
}
